Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix API being inaccessible when using FLATNOTES_AUTH_TYPE=none #90

Closed
wants to merge 1 commit into from

Conversation

codemicro
Copy link

When FLATNOTES_AUTH_TYPE=none, the API becomes inaccessible as a format check on the API token is done and is failed before the authentication type is checked.

This commit attempts to fix that by moving the auth type check after the check for the token format.

Full disclaimer that I don't really know what I'm doing with FastAPI - this feels like a bit of a bodge. The context behind this PR is that I use a 3rd-party authentication system on top of Flatnotes and I can't use the API.

Cheers :)

When FLATNOTES_AUTH_TYPE=none, the API becomes inaccessible as a
format check on the API token is done and is failed before the
authentication type is checked.

This commit places the auth type check after the check for the
token format as an attempt to fix this.
@dullage
Copy link
Owner

dullage commented Jul 23, 2023

Thanks for the contribution. This is certainly a drawback that I'd like to fix.

As it's related to authentication, I'd like to spend some time digging into the FastAPI docs to get a better understanding of the change before I merge it. I'll get to this as soon as I get a chance.

@dullage
Copy link
Owner

dullage commented Jul 28, 2023

I took a look into this and unfortunately, this approach didn't work out.

I was able to find a solution though which is now available in the develop branch. See this commit.

@codemicro
Copy link
Author

Awesome - thanks for taking a look and sorting it in the end :)

@codemicro codemicro closed this Jul 28, 2023
@codemicro codemicro deleted the fix-authtype-none branch July 28, 2023 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants